package com.googlecode.frank.driver.Util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author Ila Pawar
 *
 */
public class Common {
	
	public static String markedexpressionbuilder(String type,String value){
		String expr =type+" marked:\'"+value+"\'";
		return expr;
	}
	
	
	
	
	/**
	 * @param pwd:sending keystroke via keyborad 
	 */
	public static void sendcommandtoKeyboard(String pwd){
		

		
		System.out.println("excecuting script");
		String[] cmd = { "osascript", "-e",	" tell app \"System Events\"  to activate keystroke \""+pwd +"\""};
		String[] simulatorCMD = { "osascript", "-e",	" tell app \"iPhone Simulator\"  to activate " };
		Process process = null;
		try {
			process = Runtime.getRuntime().exec(simulatorCMD);
			process = Runtime.getRuntime().exec(cmd);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			System.out.println("oops");
			e.printStackTrace();
		}
	}
	
	

		

}

